﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EntityObjects;
using BAL.Controller;

namespace PresentationLayer.View
{
    public partial class Welcome : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            Employee emp = new Employee();
            emp.EmpId = txtEmpId.Text.Trim();
            emp.Password = txtPassword.Text.Trim();
            LoginControl login = new LoginControl();


            Employee loginEmp = login.VerifyUser(emp);
            if (loginEmp != null)
            {
                Session["CurrentUser"] = loginEmp;
            }
            Label1.Text = loginEmp.EmpName + " " + loginEmp.RoleId;

            //Employee loginEmp = login.VerifyUser(emp); TNS
            loginEmp = login.VerifyUser(emp);
            if (loginEmp != null)
            {
                Session["CurrentUser"] = loginEmp;
                //Response.Redirect("StoreClerk/ViewRetrievalForm.aspx");
                Response.Redirect("DelHeadV1.aspx");

            }
            Label1.Text = loginEmp.EmpName + " " + loginEmp.RoleId;

        }
    }
}